{extend name="public:adminbase" /}

{block name="content"}

<div class="container-fluid p-t-15">

  <div class="row">
    <div class="col-sm-6 col-md-3">
      <div class="card bg-primary">
        <div class="card-body clearfix">
          <div class="pull-right">
            <p class="h4 text-white m-t-0">共有昵称</p>
            <p class="h3 text-white m-b-0">{$count_nickname}</p>
          </div>
          <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-currency-cny fa-1-5x"></i></span> </div>
        </div>
      </div>
    </div>

    <div class="col-sm-6 col-md-3">
      <div class="card bg-danger">
        <div class="card-body clearfix">
          <div class="pull-right">
            <p class="h4 text-white m-t-0">共有头像</p>
            <p class="h3 text-white m-b-0">{$count_headimgurl}</p>
          </div>
          <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-account fa-1-5x"></i></span> </div>
        </div>
      </div>
    </div>

  </div>


  <div class="row">

    <div class="col-lg-6">
      <div class="card">
        <div class="card-header">
          <h4>操作菜单</h4>
        </div>
        <div class="card-body">
          <div class="table-responsive">
            <table class="table table-hover">
              <thead>
              <tr>
                <th>#</th>
                <th>项目名称</th>

                <th>状态</th>

              </tr>
              </thead>
              <tbody>
              <tr>
                <td>1</td>
                <td>当前可合成用户
                  {if $count_headimgurl < $count_nickname}
                    {$count_headimgurl}
                  {else /}
                    {$count_nickname}
                  {/if}
                  个
                  ,请输入需要合成的个数
                  <input  class="form-control" type="number" id="num" name="num" placeholder="请输入..">

                </td>

                <td>
                  <button class="btn btn-label btn-primary" onclick="create_user()">
                    <label><i class="mdi mdi-checkbox-marked-circle-outline"></i></label>
                    一键合成
                  </button>
                </td>
              </tr>

              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>

  </div>

</div>

{include file="public/afooter"}
<script>
  function create_user() {
      var url="{:url('index')}";
      var num = $("#num").val();
      var data = {
          num:num
      };

      $.post(url,data,function (e) {
          if(e.code ==200){
              success(e.msg);
          } else {
              error(e.msg);
          }
      })
  }
</script>
{/block}